<?php

namespace app\admin\controller;

use app\BaseController;
use app\admin\model\User as UserModel;

class User extends BaseController
{
    public function list()
    {
        if (!$this->request->auth) return show(config('status.auth'), '认证失败');
        $page = input('page', 1, 'intval');
        $perpage = 10;
        $result = UserModel::order('id desc')->page($page, $perpage)->select();
        $total = UserModel::count();
        $data = [
            'total' => $total,
            'current' => $page,
            'perpage' => $perpage,
            'data' =>  $result
        ];
        return show(200, '会员列表', $data);
    }
}
